/**
 * Created by Ysssssss on 20/3/12.
 */
import React, { forwardRef, useState } from 'react';
import { Spin } from 'antd';

export const LoadingIcon = props => (
    <Spin size="large"
          className="loading-container"
          { ...props }
    />
);

const LoadingPage = (props) => {
    const [visible, setVisible] = useState(false)

    window.loadingRefs = {
        show: () => setVisible(true),
        hide: () => setVisible(false)
    }

    return (
        <LoadingIcon spinning={visible} tip="数据请求中，请稍候" delay={500}/>
    )
}


export default LoadingPage